<?php
namespace app\admin\validate;

class ApiSupplierValidate extends CommonValidate
{
    /**
     * 验证规则
     * @var string[]
     */
    protected $rule     =   [
        'user_id'       =>  'require|number',       // 账号
        'supplier_title'=>  'require',              // 名称
        'supplier_tel'  =>  'require|isMobile',     // 手机号
    ];

    /**
     * 提示消息
     * @var string[]
     */
    protected $message              =   [
        'user_id.require'           =>  '请选择账号',
        'user_id.number'            =>  '账号值必须为数字',
        'supplier_title.require'    =>  '请填写名称',
        'supplier_tel.require'      =>  '请填写手机号',
        'supplier_tel.isMobile'     =>  '手机号格式错误',
    ];

    /**
     * 验证对象
     * @var array[]
     */
    protected $scene =  [
		'fields'    =>  ['*'],
		'add'       =>  ['user_id','supplier_title','supplier_tel'],
		'edit'      =>  ['user_id','supplier_title','supplier_tel'],
    ];
}